﻿<Window x:Class="Chem4Word.UI.WebServices.OpsinLookUp" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converters="clr-namespace:Chem4Word.UI.Converters" xmlns:UIControls="clr-namespace:Chem4Word.UI.UIControls" Activated="Window_Activated" Loaded="opsinLookUp_Loaded" ShowInTaskbar="False" SizeToContent="WidthAndHeight" MinWidth="200" Topmost="True" x:Name="opsinLookUp" Title="OPSIN name to structure service">
	<Window.Resources>
		<converters:NullToBooleanConverter x:Key="NullToBooleanConverter" />
		<Style TargetType="{x:Type Button}" x:Key="BasicButtonStyle">
			<Setter Property="Height" Value="25" />
			<Setter Property="Width" Value="70" />
			<Setter Property="Margin" Value="6,0,6,0" />
		</Style>

		<Style TargetType="{x:Type Button}" x:Key="ImportButtonStyle" BasedOn="{StaticResource BasicButtonStyle}">
			<Setter Property="IsEnabled" Value="{Binding ElementName=opsinLookUp, Path=ResultDocument, Converter={StaticResource NullToBooleanConverter}}" />
		</Style>
		<Style TargetType="{x:Type FlowDocumentReader}">
			<Setter Property="Visibility" Value="Collapsed" />
			<Style.Triggers>
				<DataTrigger Binding="{Binding ElementName=opsinLookUp, Path=ResultDocument, Converter={StaticResource NullToBooleanConverter}}" Value="True">
					<Setter Property="Visibility" Value="Visible" />
				</DataTrigger>
			</Style.Triggers>
		</Style>

		<Style TargetType="{x:Type Grid}">
			<Setter Property="Visibility" Value="Collapsed" />
			<Style.Triggers>
				<DataTrigger Binding="{Binding ElementName=opsinLookUp, Path=ResultDocument, Converter={StaticResource NullToBooleanConverter}}" Value="True">
					<Setter Property="Visibility" Value="Visible" />
				</DataTrigger>
			</Style.Triggers>
		</Style>
		<Style TargetType="{x:Type Label}">
			<Setter Property="Visibility" Value="Collapsed" />
			<Style.Triggers>
				<DataTrigger Binding="{Binding ElementName=opsinLookUp, Path=ResultDocument, Converter={StaticResource NullToBooleanConverter}}" Value="False">
					<Setter Property="Visibility" Value="Visible" />
				</DataTrigger>
			</Style.Triggers>
		</Style>
	</Window.Resources>
	<StackPanel Margin="12" Name="stackPanel1" VerticalAlignment="Top" Orientation="Vertical" MinWidth="200">
		<UIControls:SearchTextBox x:Name="searchBox" VerticalAlignment="Top" Margin="6" SearchMode="Delayed" Search="SearchBoxSearch" LabelText="Chemical Name" MinWidth="100" />
		<Label Name="label" Margin="6"></Label>
		<!--<FlowDocumentReader Margin="6" ViewingMode="Scroll" Zoom="100" x:Name="reader" MaxHeight="400" MaxWidth="800">
        </FlowDocumentReader>-->
		<Grid x:Name="grid" Margin="6"></Grid>
		<StackPanel Name="buttonPanel" VerticalAlignment="Top" Orientation="Horizontal" HorizontalAlignment="Right">
			<Button Style="{StaticResource ImportButtonStyle}" Name="importButton" Click="importButton_Click">Import</Button>
			<Button Style="{StaticResource BasicButtonStyle}" Name="cancelButton" Click="cancelButton_Click">Cancel</Button>
		</StackPanel>
	</StackPanel>

</Window>